import argparse
import torch
from torch import nn
from util import try_gpu
from evaluator import Evaluator

def make_parser():
    parser = argparse.ArgumentParser("onnx deploy")
    parser.add_argument("--model", type=str, default="./Output/best.pt", help="model path")
    return parser

def main():
    args = make_parser().parse_args()
    model_path = args.model
    model = torch.load(model_path)
    model.to(device=try_gpu())

    evaluator = Evaluator(128, True)
    accuracy = evaluator.eval(model)
    print("accuracy: ", accuracy)

if __name__ == "__main__":
    main()